package com.sobot.finance.poc.web.controller;

import com.sobot.finance.poc.web.controller.base.BaseController;
import com.sobot.finance.poc.web.controller.request.GeneralReq;
import com.sobot.finance.poc.web.entity.SceneData;
import com.sobot.finance.poc.web.service.SceneService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 获取场景变量信息
 *
 * @author baiyp
 */
@RestController
@Slf4j
public class SceneController extends BaseController {

    @Resource
    private SceneService sceneService;

    @RequestMapping(value = "/poc/sceneVariable", method = RequestMethod.POST)
    public String sceneVariable(@RequestBody GeneralReq<SceneData> req) {
        log.info("[获取场景变量信息-开始]: {}", gson.toJson(req));
        String sceneVariable = sceneService.sceneVariable();
        log.info("[获取场景变量信息-结束]: {}", gson.toJson(sceneVariable));
        return sceneVariable;
    }
}
